<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang='zh-CN' xml:lang='zh-CN' xmlns='http://www.w3.org/1999/xhtml'>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta http-equiv="Content-Language" content="zh-CN"/>
        <meta name="robots" content="index, follow" />
        <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico" />
        <title>氿上网</title>
        <?php echo $this->_var['system_css']; ?>
        <?php echo $this->_var['system_js']; ?>

    </head>
    <body>
        <div id="OSC_Screen">
            <?php echo $this->fetch('header.html'); ?>
            <div id="OSC_Content" class='CenterDiv'>
                <?php echo $this->fetch('user_nav.html'); ?>
                <?php echo $this->fetch('message.html'); ?>
                <div class="MainForm" id="reg_page">

                    <h1 style="font-size:22px;margin-bottom:20px;">订单详情</h1>
                    <div>订单号：<?php echo $this->_var['data']['order_sn']; ?>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#FE4E02">订单状态：<?php echo __($this->_var['data']['status']); ?></font>&nbsp;&nbsp;订单时间：<?php echo Date::timeformat($this->_var['data']['add_time'],3); ?>&nbsp;&nbsp;&nbsp;&nbsp;<?php if (! empty ( $this->_var['data']['pay_time'] )): ?>支付时间：<?php echo Date::timeformat($this->_var['data']['pay_time'],3); ?><?php endif; ?></div>
                    <h1 style="font-size:22px;margin-bottom:20px;margin-top: 20px;">买家信息</h1>
                    <div>买家账号:<?php echo $this->_var['data']['buyer_name']; ?>&nbsp;&nbsp;&nbsp;&nbsp;买家邮件:<?php echo $this->_var['data']['buyer_email']; ?></div>


                    <h1 style="font-size:22px;margin-bottom:20px;margin-top: 20px;">产品列表</h1>
                    <div>
                        <?php if (count ( $this->_var['data']['goods_list'] ) > 0): ?>
                        <table style="border: 1px solid #CCCCCC; width: 900px;">
                            <thead>
                                <tr style="border:1px solid #ccc;">
                                    <th style="text-align:center;border: 1px solid #ccc">产品名称</th>
                                    <th style="text-align:center;border: 1px solid #ccc">产品图片</th>
                                    <th style="text-align:center;border: 1px solid #ccc">产品价格</th>
                                    <th style="text-align:center;border: 1px solid #ccc">评价</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $_from = $this->_var['data']['goods_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'list');if (count($_from)):
    foreach ($_from AS $this->_var['list']):
?>
                                <tr style="border:1px solid #ccc;">
                                    <td style="text-align:center;width:40%;border-right: 1px solid #ccc"><?php echo $this->_var['list']['goods_name']; ?></td>
                                    <td style="text-align:center;border-right: 1px solid #ccc"><img src="<?php echo $this->_var['list']['goods_image']; ?>" width="100" height="100"/></td>
                                    <td style="text-align:center;border-right: 1px solid #ccc"><?php echo $this->_var['data']['account_str']; ?></td>
                                     <td style="text-align:center;border-right: 1px solid #ccc">
                                        
                                         <?php if ($this->_var['data']['status'] == 'success' && $this->_var['data']['user_type'] == 'buyer' && $this->_var['list']['is_comment'] == 'uncomment'): ?>
                                         <a href="/shop/user/goods/comment/<?php echo $this->_var['list']['goods_id']; ?>"> 买家评论</a>
                                         <?php elseif ($this->_var['data']['status'] == 'success' && $this->_var['data']['user_type'] == 'seller' && $this->_var['list']['is_reply'] == 'unreply'): ?>
                                         <a href="/shop/user/goods/reply/<?php echo $this->_var['list']['comment_id']; ?>">卖家回复</a>
                                         <?php elseif ($this->_var['list']['is_comment'] == 'commented'): ?>
                                         产品已评价
                                         <?php else: ?>
                                         亲!订单成功后再评论..
                                         <?php endif; ?>
                                         
                                         
                                     </td>
                                </tr>
                                <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                            </tbody>

                        </table>
                        <?php endif; ?>
                    </div>


                    <h1 style="font-size:22px;margin-bottom:20px;margin-top: 20px;">订单操作</h1>
                    <div>

                        <?php if (count ( $this->_var['data']['order_logs'] ) > 0): ?>
                        <table style="border: 1px solid #CCCCCC; width: 900px;">
                            <thead>
                                <tr style="border:1px solid #ccc;">
                                    <th style="text-align:center;border: 1px solid #ccc">操作人</th>
                                    <th style="text-align:center;border: 1px solid #ccc">操作状态</th>
                                    <th style="text-align:center;border: 1px solid #ccc">转为状态</th>
                                    <th style="text-align:center;border: 1px solid #ccc">操作时间</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $_from = $this->_var['data']['order_logs']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'list');if (count($_from)):
    foreach ($_from AS $this->_var['list']):
?>
                                <tr style="border:1px solid #ccc;">
                                    <td style="text-align:center;width:40%;border: 1px solid #ccc"><?php echo $this->_var['list']['operator']; ?></td>
                                    <td style="text-align:center;border: 1px solid #ccc"><?php echo __($this->_var['list']['order_status']); ?></td>
                                    <td style="text-align:center;border: 1px solid #ccc"><?php echo __($this->_var['list']['changed_status']); ?></td>
                                    <td style="text-align:center;border: 1px solid #ccc"><?php echo Date::timeformat($this->_var['list']['log_time'],3); ?></td>
                                </tr>
                                <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                            </tbody>

                        </table>
                        <?php endif; ?>

                    </div>

                    <h1 style="font-size:22px;margin-bottom:20px;margin-top: 20px;">我要操作</h1>
                    <form action="/shop/<?php echo $this->_var['data']['user_type']; ?>/order/operate" method="post">
                        <input type="hidden" value="<?php echo $this->_var['_token']; ?>" name="_token"/>
                        <input type="hidden" value="<?php echo $this->_var['data']['id']; ?>" name="order_id"/>

                        <?php if ($this->_var['data']['user_type'] == 'seller'): ?>
                        <?php if ($this->_var['data']['status'] == 'payed'): ?>
                        <input type="radio" value="shipped" name="pay_status" checked="true"/>发货&nbsp;&nbsp;&nbsp;
                        <?php endif; ?>
                        <?php endif; ?>

                        <?php if ($this->_var['data']['user_type'] == 'buyer'): ?>
                        <?php if ($this->_var['data']['status'] == 'shipped'): ?>
                        <input type="radio" value="success" name="pay_status" checked="true"/>收货&nbsp;&nbsp;&nbsp;
                        <?php endif; ?>

                        <?php if ($this->_var['data']['status'] == 'unpay'): ?>
                        <input type="radio" value="payed" name="pay_status" checked="true"/>付款&nbsp;&nbsp;&nbsp;
                        <?php endif; ?>
                        <?php endif; ?>
                        <?php if ($this->_var['data']['status'] == 'unpay'): ?>
                        <input type="radio" value="canceled" name="pay_status" checked="true"/>取消&nbsp;&nbsp;&nbsp;
                        <?php endif; ?>

                        <input type="submit" value="确认" />
                        

                    </form>
                    <div class='clear'></div>
                </div>

            </div>
            <div class='clear'></div></div>
        <div class='clear'></div>
        <?php echo $this->fetch('footer.html'); ?>
        </div>


    </body>
</html>
